package com.kx.kxblog.bean;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "Result", description = "统一返回结果")
public class Result<D> {
    @ApiModelProperty(value = "状态码", required = true)
    private int code;

    @ApiModelProperty(value = "结果提示", required = true)
    private String msg;

    @ApiModelProperty(value = "返回值", required = true)
    private D data;

    public Result(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}